<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%
String path = request.getContextPath();
String msg = (String)request.getAttribute("tipMessage");
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>用户登录</title>
    <link href="<%=path %>/themes/css/login.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript">
	
	<c:if test="${tipMessage!=null}">
		alert('<c:out value="${tipMessage}"/>');
	</c:if>
	
	function changeValidateCode(obj) {    
		//获取当前的时间作为参数，无具体意义    
		var timenow = new Date().getTime();    
		//每次请求需要一个不同的参数，否则可能会返回同样的验证码    
		//这和浏览器的缓存机制有关系，也可以把页面设置为不缓存，这样就不用这个参数了。    
		obj.src="<%=path %>/randomCode/getRandomCode.action?d="+timenow;    
	} 
	
	function login(){
		if(document.getElementById("user.account").value==''){
			alert("请输入用户名!");
			return false;
		}
		if(document.getElementById("user.password").value==''){
			alert("请输入密码!");
			return false;
		}
		if(document.getElementById("randomCode").value==''){
			alert("请输入验证码!");
			return false;
		}
		form1.submit();
	}   
	</script>    
  </head>
<body>
	<div id="login">
		<div id="login_header">
			<h1 class="login_logo">
				<a href="http://demo.dwzjs.com"><img src="<%=path %>/themes/default/images/login_logo.gif" /></a>
			</h1>
			<div class="login_headerContent">
				<div class="navList">
					<ul>
						
					</ul>
				</div>
				<h2 class="login_title"><img src="<%=path %>/themes/default/images/login_title.png" /></h2>
			</div>
		</div>
		<div id="login_content">
			<div class="loginForm">
				<form name="form1" action="<%=path %>/login/loginDo.action"  method="post" >
					<p>
						<label>用户名：</label>
						<input type="text" name="user.account" id="user.account" size="20" class="required" />
					</p>
					<p>
						<label>密码：</label>
						<input type="password" name="user.password" id="user.password" size="20" class="required" />
					</p>
					 
					<p>
						<label>验证码：</label>
						<input class="code" type="text" size="5" id="randomCode" name="randomCode" />
						<span><img src="<%=path %>/randomCode/getRandomCode.action" alt="" width="75" height="24" onclick="changeValidateCode(this);"/></span>
					</p>
					
					<div class="login_bar">
						<input class="sub" type="button" value=" " onclick="login();"/>
					</div>
				</form>
			</div>
			<div class="login_banner"><img src="<%=path %>/themes/default/images/login_banner.jpg"/></div>
			<div class="login_main">
				<ul class="helpList">

				</ul>
				<div class="login_inner">

				</div>
			</div>
		</div>
		<div id="login_footer">
			Copyright &copy; 2012 younion.
		</div>
	</div>
</body>
</html>
